//
//  DJShowSelectTool.m
//  DJMedical
//
//  Created by 张明辉 on 16/12/22.
//  Copyright © 2016年 jesse. All rights reserved.
//

#import "DJShowSelectTool.h"
#import "LTPickerView.h"

@implementation DJShowSelectTool
+ (void)showSelectWithArr:(NSArray *)arr andDefaultStr:(NSString *)defaultStr complete:(void(^)(NSString *selectedStr,NSInteger num))complete
{
    LTPickerView* pickerView = [LTPickerView new];
    pickerView.dataSource = arr;//设置要显示的数据
    pickerView.defaultStr = defaultStr;//默认选择的数据
    [pickerView show];//显示
    //回调block
    pickerView.block = ^(LTPickerView* obj,NSString* str,NSInteger num){
        //obj:LTPickerView对象
        //str:选中的字符串
        //num:选中了第几行
        if (complete) {
            complete(str,num);
        }
    };
}
@end
